package com.bruce.tool.pay.alipay.wap.to;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author Bruce(刘正航)
 */
@Data
public class WapPayAliTo implements Serializable {
    @NotBlank(message = "支付标题(subject)不能为空")
    private String subject;
    @NotBlank(message = "支付单号(orderNo)不能为空")
    private String orderNo;
    @NotBlank(message = "支付金额(totalAmount)不能为空")
    private String totalAmount;
    @NotBlank(message = "中途退出页面地址(quitUrl)不能为空")
    private String quitUrl;
    private String returnUrl;
    /**
     * 回传参数(透传)
     */
    private String passback;

    public static WapPayAliTo translate(String subject, String orderNo, String totalAmount, String quitUrl) {
        WapPayAliTo to = new WapPayAliTo();
        to.setSubject(subject);
        to.setOrderNo(orderNo);
        to.setTotalAmount(totalAmount);
        to.setQuitUrl(quitUrl);
        return to;
    }

    public static WapPayAliTo translate(String subject, String orderNo, String totalAmount, String quitUrl, String passback) {
        WapPayAliTo to = new WapPayAliTo();
        to.setSubject(subject);
        to.setOrderNo(orderNo);
        to.setTotalAmount(totalAmount);
        to.setQuitUrl(quitUrl);
        to.setPassback(passback);
        return to;
    }
}
